home *** CD-ROM | disk | FTP | other *** search
/ BCI NET 2 / BCI NET 2.iso / archives / utilities / commodity / watcher1.0.lha / watcher / watchermain.rexx < prev   
Encoding:
OS/2 REXX Batch file  |  1995-02-28  |  1.8 KB  |  29 lines

  1. /* Watcher v1.00 by Case of Energy Telecommunications */
  2. options results
  3. if ~exists("sysdata:watcher.data") then call CREATE
  4. arg z;reset=0;x=1;if z='SORT' then reset=1;tot=0;high=0;call open(subz,'sysdata:watcher.data',r);no=readln(subz)
  5. name=z;do until x = (no+1);subname.x =readln(subz);if subname.x=name then reset=1;if reset=0 then do
  6. if subname.x="xxx" then do;subname.x=name;reset=1;end;end;subno.x =readln(subz);tot=tot+subno.x;if subno.x>high then high=subno.x;x=x+1;end
  7. call close(subz);if reset=0 then do;no=no+1;subname.no=name;subno.no=0;end
  8. if z='RETRIEVE' then call RETRIEVE;x=1;if z='SORT' then call SORT;call open(subz,'sysdata:watcher.data',w);writeln(subz,no);do until x = (no+1)
  9. if subname.x=name then subno.x=subno.x+1;writeln(subz,subname.x);writeln(subz,subno.x);x=x+1;end;call close(subz);exit
  10. CREATE:
  11. no=2;call open(start,'SYSDATA:watcher.data',w);writeln(start,no-1);do until x = (no+1);writeln(start,"xxx");writeln(start,0);x=x+1;end;call close(start);exit
  12. SORT:
  13. transmit "f1}n1}cf}z4} WATCHER v1.00 by Case z0}n2}cb}Generating Reportc7}: cf}00cd}% cb}completec7}."
  14. call open(pre,'RAM:watcher.temp',w);writeln(pre,"f1}>25}z5}cf} WATCHER Sub-board Entry Report z0}n1}")
  15. cl=5;x=1;do until x = (no+1);per=trunc(x/(no+1),2);transmit 'f0}n3}>19}cf}'right(per,2)
  16. ans=subno.x/tot;gph=subno.x/high;grp=trunc(40*gph);ans=trunc(ans,2);form=left(subno.x,4)"c7}(ce}"right(ans,2)"%c7})"
  17. if grp < 1 then grp=1;if length(subname.x)>29 then subname.x=compress(subname.x,"C")
  18. writech(pre,form"ce}");writech(pre,"cf}  cb}"left(subname.x"c4}",32,".")"z4}cd}")
  19. y=0;do until y = grp;writech(pre,"±");y=y+1;end;writeln(pre,"z0}cf}");x=x+1;end;call close(pre);sendstring '$ sort from RAM:WATCHER.TEMP to SYSDATA:watcher.report NUMERIC}';sendstring '$ delete ram:watcher.temp}';sendfile 'sysdata:watcher.report';exit
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.